package com.hxd.mall.module.school.audio

import com.alibaba.android.arouter.facade.annotation.Route
import com.hxd.mall.R
import com.hxd.mall.base.BaseInjectActivity
import com.hxd.mall.constant.HxdConstantsRouterPath.School.path_school_audio
import com.hxd.mall.utils.local.getListAdapter
import com.hxd.mall.utils.local.getModule
import com.hxd.mall.utils.open.initRecyclerView
import kotlinx.android.synthetic.main.activity_audio_list_layout.*

/**
 * 听商学院讲堂 更多页
 */
@Route(path = path_school_audio)
class AudioActivity : BaseInjectActivity<IAudioPresenter>(), IAudioView {

    override fun attachLayoutRes(): Int = R.layout.activity_audio_list_layout

    override fun initViews() {
        //setTitleCommon(getString(R.string.school_listener))
        initListView()
    }

    private fun initListView() {
    }

    override fun initData() {
        val moduleLayout = getModule(intent.getStringExtra("list"))
        if (moduleLayout != null) {
            val title =
                if (moduleLayout.title.isEmpty()) getString(R.string.school_listener) else moduleLayout.title
            setTitleCommon(title)

            audioList.initRecyclerView(getListAdapter(moduleLayout.resources, AudioAllListAdapter()), padding = 0, leftPadding = 58, color = R.color.color_F0F0F0)
        }
    }

    override fun showData() {
    }

}
